//
//  RootCollectionViewCell.m
//  TheVideoClip
//
//  Created by 北斗君合MacMini on 2018/3/30.
//  Copyright © 2018年 北斗君合MacMini. All rights reserved.
//

#import "RootCollectionViewCell.h"

#import "RootModel.h"

@interface RootCollectionViewCell ()



@end

@implementation RootCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        _cornerRadius = 10;
        if (!_titleLabel) {
            _titleLabel = [CreateControlTool getLabelWithText:@"" numberLines:0 textColor:[UIColor whiteColor] fontSize:17 textAlignment:NSTextAlignmentCenter];
            _titleLabel.layer.cornerRadius = _cornerRadius;
            _titleLabel.layer.masksToBounds = YES;
            [self.contentView addSubview:_titleLabel];
            [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
                make.edges.equalTo(self.contentView);
            }];
        }
    }
    return self;
}

- (void)setModel:(RootModel *)model {
    _model = model;
    _titleLabel.text = model.title;
    
    _titleLabel.backgroundColor = [CommonMethodTool getRandomColorWithAlpha:0.7];
}

@end
